package me.littlesquid.bettertp;

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.profile.PlayerProfile;

import java.util.UUID;

public class head {
    public static ItemStack getHead(Player player){
        UUID uuid=player.getUniqueId();
        String name=player.getName();
        PlayerProfile playerProfile= Bukkit.getServer().createPlayerProfile(uuid,name);
        ItemStack itemStack=new ItemStack(Material.PLAYER_HEAD);
        SkullMeta skullMeta= (SkullMeta) itemStack.getItemMeta();
        skullMeta.setOwnerProfile(playerProfile);
        itemStack.setItemMeta(skullMeta);
        return itemStack;
    }
}
